from .models import Task

# 在API中如何表示
API_NAME = 'tasks'
# 对应的Model
MODEL_NAME = Task
# 基于哪个字段筛选
SEARCH_BY = 'task_name'
# 模板的名字
TEMPLATE_NAME = 'index'
# 字段列表
COLUMN_LIST = ['id', 'task_name', 'comments']
# 表单的配置
FORM_INFO_TASK = {
    "name": "TASK",
    "api_name": "task/api/task",
    "columns": {
        'task_name': {
            "list_title": "Task Name",
            "id": "task_name",
            "type": "text"
        },
        'comments': {
            "list_title": "Comments",
            "id": "comments",
            "type": "text"
        }
    }
}
# 表单返回后端的校验
FORM_INFO_VALIDATE = {
    "column_list" : ['task_name', 'comments'],
    "task_name" : {
        'type': str,
        'length': 128
    },
    "comments" : {
        'type': str,
        'length': 256
    }

}

